<%@page import="org.shop.entity.security.MyUserDetail" %>
<%@page import="org.shop.util.ObjUtil" %>
<%@page import="org.springframework.security.core.context.SecurityContextImpl" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

    SecurityContextImpl securityContextImpl = (SecurityContextImpl) request.getSession().getAttribute("SPRING_SECURITY_CONTEXT");
    MyUserDetail ud = null;
    Byte state = 1;
    if (ObjUtil.isNotNullAndEmpty(securityContextImpl)) {
        ud = (MyUserDetail) securityContextImpl.getAuthentication().getPrincipal();
        state = ud.getState();
    }
%>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1 user-scalable=0">
    <title>二手列表</title>
    <link rel="stylesheet" href="<%=basePath%>assets/css/public.css">
    <link rel="stylesheet" href="<%=basePath%>assets/css/page.css">
    <link rel="stylesheet" href="<%=basePath%>assets/font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="<%=basePath%>assets/js/jquery-1.8.3.min.js"></script>
    <script src="<%=basePath%>assets/js/fontSize.js"></script>
    <style>

        body{
            padding-top: 0.8rem;
        }
        .goods {
            margin: 0.2rem 0;
        }

        .goods_list {
            padding: 0 0.2rem;
        }

        .photo {
            width: 0.8rem;
        }

        .photo img {
            width: 0.7rem;
            height: 0.7rem;
            border-radius: 50%;
        }

        .info {
            line-height: 0.36rem;
            margin-top: 0.02rem;
            font-size: 0.26rem;
        }
        .time {
            color: #989898;
            font-size: 0.24rem;
        }

        .goods_introduce {
            line-height: 0.4rem;
            margin: 0.2rem 0;
            font-size: 0.28rem;
        }

        .goods_img img {
            width: 2rem;
            height: 2.4rem;
            margin-right: 0.12rem;
        }

        .operation {
            line-height: 0.8rem;
            text-align: right;
            font-size: 0.26rem;
            margin-top: 0.2rem;
        }

        .operation_btn {
            padding:0.1rem;
            position: relative;
            margin-left: 0.1rem;
        }

        .operation_btn i {
            width:0.4rem;
            height:0.4rem;
            display: inline-block;
            position: absolute;
            top:0.04rem;
            background-size: cover;
            margin-right: 0.06rem;
        }
        .operation_btn span{
            margin-left: 0.5rem;
        }
        .favorite_o{
            background-image: url("<%=basePath%>assets/images/favorite.png");
        }
        .active_favorite{
            background-image: url("<%=basePath%>assets/images/active_favorite.png");
        }
        .info_img{
            background-image: url("<%=basePath%>assets/images/info_img.png");
        }
    </style>
</head>
<body>
<input id="basePath" type="hidden" value="<%=basePath%>">
<div class="header">
    <a class="returnInfo" href="#" onclick="window.history.go(-1)"><i class="fa fa-angle-left"></i></a>
</div>
<div class="goods_list">
    <div class="goods border-bottom-1">
        <div class="business_info clearFirx">
            <div class="photo float_l">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="info float_l">
                <span class="name">商家名称</span><br>
                <span class="time">2018-08-08 08:08</span>
            </div>
        </div>
        <div class="goods_detail">
            <p class="goods_introduce">
                商品介绍吗？
                不知道这个位置是干嘛的，甚至不知道这个页面是不是放商品。
                反正暂时就这么放着吧，取名字都是按照商品取的。
            </p>
            <div class="goods_img">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="operation">
                <span class="operation_btn favorite">
                    <i class="favorite_o"></i>
                    <span>321</span>
                </span>
                <span class="operation_btn message">
                    <i class="info_img"></i>
                    <span>456</span>
                </span>
            </div>
        </div>
    </div>
    <div class="goods border-bottom-1">
        <div class="business_info clearFirx">
            <div class="photo float_l">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="info float_l">
                <span class="name">商家名称</span><br>
                <span class="time">2018-08-08 08:08</span>
            </div>
        </div>
        <div class="goods_detail">
            <p class="goods_introduce">
                商品介绍吗？
                不知道这个位置是干嘛的，甚至不知道这个页面是不是放商品。
                反正暂时就这么放着吧，取名字都是按照商品取的。
            </p>
            <div class="goods_img">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="operation">
                <span class="operation_btn favorite">
                    <i class="favorite_o"></i>
                    <span>321</span>
                </span>
                <span class="operation_btn message">
                    <i class="info_img"></i>
                    <span>456</span>
                </span>
            </div>
        </div>
    </div>
    <div class="goods border-bottom-1">
        <div class="business_info clearFirx">
            <div class="photo float_l">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="info float_l">
                <span class="name">商家名称</span><br>
                <span class="time">2018-08-08 08:08</span>
            </div>
        </div>
        <div class="goods_detail">
            <p class="goods_introduce">
                商品介绍吗？
                不知道这个位置是干嘛的，甚至不知道这个页面是不是放商品。
                反正暂时就这么放着吧，取名字都是按照商品取的。
            </p>
            <div class="goods_img">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
                <img src="<%=basePath%>assets/images/timg(2).jpg" alt="">
            </div>
            <div class="operation">
                <span class="operation_btn favorite">
                    <i class="favorite_o"></i>
                    <span>321</span>
                </span>
                <span class="operation_btn message">
                    <i class="info_img"></i>
                    <span>456</span>
                </span>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    $(".header_ul a").click(function () {
        $(".header_ul a").removeClass("active");
        $(this).addClass("active");
    })
    $(".look_more").click(function () {
        $(".label_box").toggleClass("max_height")
    })
    $(".favorite").click(function () {
        $(this).find("i").toggleClass("favorite_o");
        $(this).find("i").toggleClass("active_favorite")
    });
</script>
</html>